<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Cheetah Software: SharedMemorySemaphore Class Reference</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Cheetah Software
   &#160;<span id="projectnumber">1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="../../annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="../../classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="../../inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="../../functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('db/d41/class_shared_memory_semaphore.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="../../de/d31/class_shared_memory_semaphore-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">SharedMemorySemaphore Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>&gt;</code></p>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Collaboration diagram for SharedMemorySemaphore:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../d9/d68/class_shared_memory_semaphore__coll__graph.png" border="0" usemap="#_shared_memory_semaphore_coll__map" alt="Collaboration graph"/></div>
<map name="_shared_memory_semaphore_coll__map" id="_shared_memory_semaphore_coll__map">
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:acb002c7dce852e4548ee4b8a32e67b97"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#acb002c7dce852e4548ee4b8a32e67b97">init</a> (unsigned int value)</td></tr>
<tr class="separator:acb002c7dce852e4548ee4b8a32e67b97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb9099d74c7a7162f90ea7ae7c036b65"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#afb9099d74c7a7162f90ea7ae7c036b65">increment</a> ()</td></tr>
<tr class="separator:afb9099d74c7a7162f90ea7ae7c036b65"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92848ad136712dbfd7ce309e1ac472d9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#a92848ad136712dbfd7ce309e1ac472d9">decrement</a> ()</td></tr>
<tr class="separator:a92848ad136712dbfd7ce309e1ac472d9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1320f7671180868cccce16df1894f5d7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#a1320f7671180868cccce16df1894f5d7">tryDecrement</a> ()</td></tr>
<tr class="separator:a1320f7671180868cccce16df1894f5d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2eb2442863ed4831fb1cce64d30f177"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#ad2eb2442863ed4831fb1cce64d30f177">decrementTimeout</a> (<a class="el" href="../../d0/d99/c_types_8h.html#a3f7e2bcbb0b4c338f3c4f6c937cd4234">u64</a> seconds, <a class="el" href="../../d0/d99/c_types_8h.html#a3f7e2bcbb0b4c338f3c4f6c937cd4234">u64</a> nanoseconds)</td></tr>
<tr class="separator:ad2eb2442863ed4831fb1cce64d30f177"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a40f2809c80adfa7a7ffc055ec3baad9a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#a40f2809c80adfa7a7ffc055ec3baad9a">destroy</a> ()</td></tr>
<tr class="separator:a40f2809c80adfa7a7ffc055ec3baad9a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:abd4a2bf1a865ebb76bd57a8fcbcacdbe"><td class="memItemLeft" align="right" valign="top">sem_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">_sem</a></td></tr>
<tr class="separator:abd4a2bf1a865ebb76bd57a8fcbcacdbe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7c24bb06e6a2fada9570f34a11afe87e"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html#a7c24bb06e6a2fada9570f34a11afe87e">_init</a> = false</td></tr>
<tr class="separator:a7c24bb06e6a2fada9570f34a11afe87e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>A POSIX semaphore for shared memory. See <a href="https://linux.die.net/man/7/sem_overview">https://linux.die.net/man/7/sem_overview</a> for more deatils </p>

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00027">27</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a92848ad136712dbfd7ce309e1ac472d9"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SharedMemorySemaphore::decrement </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>If the semaphore's value is &gt; 0, decrement the value. Otherwise, wait until its value is &gt; 0, then decrement. </p>

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00059">59</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

<p>References <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00089">_sem</a>.</p>
<div class="fragment"><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;{ sem_wait(&amp;<a class="code" href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">_sem</a>); }</div><div class="ttc" id="class_shared_memory_semaphore_html_abd4a2bf1a865ebb76bd57a8fcbcacdbe"><div class="ttname"><a href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">SharedMemorySemaphore::_sem</a></div><div class="ttdeci">sem_t _sem</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/dac/_shared_memory_8h_source.html#l00089">SharedMemory.h:89</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-1" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-1-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-1-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-1-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../db/d41/class_shared_memory_semaphore_a92848ad136712dbfd7ce309e1ac472d9_icgraph.png" border="0" usemap="#db/d41/class_shared_memory_semaphore_a92848ad136712dbfd7ce309e1ac472d9_icgraph" alt=""/></div>
<map name="db/d41/class_shared_memory_semaphore_a92848ad136712dbfd7ce309e1ac472d9_icgraph" id="db/d41/class_shared_memory_semaphore_a92848ad136712dbfd7ce309e1ac472d9_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ad2eb2442863ed4831fb1cce64d30f177"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedMemorySemaphore::decrementTimeout </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="../../d0/d99/c_types_8h.html#a3f7e2bcbb0b4c338f3c4f6c937cd4234">u64</a>&#160;</td>
          <td class="paramname"><em>seconds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="../../d0/d99/c_types_8h.html#a3f7e2bcbb0b4c338f3c4f6c937cd4234">u64</a>&#160;</td>
          <td class="paramname"><em>nanoseconds</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Like decrement, but after waiting ms milliseconds, will give up Returns true if the semaphore is successfully decremented </p>

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00072">72</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

<p>References <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00089">_sem</a>.</p>
<div class="fragment"><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;                                                      {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    <span class="keyword">struct </span>timespec ts;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;    clock_gettime(CLOCK_REALTIME, &amp;ts);</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    ts.tv_nsec += nanoseconds;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;    ts.tv_sec += seconds;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    ts.tv_sec += ts.tv_nsec / 1000000000;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;    ts.tv_nsec %= 1000000000;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    <span class="keywordflow">return</span> (sem_timedwait(&amp;<a class="code" href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">_sem</a>, &amp;ts) == 0);</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;  }</div><div class="ttc" id="class_shared_memory_semaphore_html_abd4a2bf1a865ebb76bd57a8fcbcacdbe"><div class="ttname"><a href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">SharedMemorySemaphore::_sem</a></div><div class="ttdeci">sem_t _sem</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/dac/_shared_memory_8h_source.html#l00089">SharedMemory.h:89</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="a40f2809c80adfa7a7ffc055ec3baad9a"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SharedMemorySemaphore::destroy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Delete the semaphore. Note that deleting a semaphore in one process while another is still using it results in very strange behavior. </p>

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00086">86</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

<p>References <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00089">_sem</a>.</p>
<div class="fragment"><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;{ sem_destroy(&amp;<a class="code" href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">_sem</a>); }</div><div class="ttc" id="class_shared_memory_semaphore_html_abd4a2bf1a865ebb76bd57a8fcbcacdbe"><div class="ttname"><a href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">SharedMemorySemaphore::_sem</a></div><div class="ttdeci">sem_t _sem</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/dac/_shared_memory_8h_source.html#l00089">SharedMemory.h:89</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="afb9099d74c7a7162f90ea7ae7c036b65"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SharedMemorySemaphore::increment </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Increment the value of the semaphore. </p>

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00053">53</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

<p>References <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00089">_sem</a>.</p>
<div class="fragment"><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;{ sem_post(&amp;<a class="code" href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">_sem</a>); }</div><div class="ttc" id="class_shared_memory_semaphore_html_abd4a2bf1a865ebb76bd57a8fcbcacdbe"><div class="ttname"><a href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">SharedMemorySemaphore::_sem</a></div><div class="ttdeci">sem_t _sem</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/dac/_shared_memory_8h_source.html#l00089">SharedMemory.h:89</a></div></div>
</div><!-- fragment -->
</div>
</div>
<a class="anchor" id="acb002c7dce852e4548ee4b8a32e67b97"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">void SharedMemorySemaphore::init </td>
          <td>(</td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>value</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>If semaphore is unitialized, initialize it and set its value. This can be called as many times as you want safely. It must be called at least once. Only one process needs to call this, even if it is used in multiple processes.</p>
<p>Note that if <a class="el" href="../../db/d41/class_shared_memory_semaphore.html#acb002c7dce852e4548ee4b8a32e67b97">init()</a> is called after the semaphore has been initialized, it will not change its value. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">value</td><td>The initial value of the semaphore. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00039">39</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

<p>References <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00090">_init</a>, and <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00089">_sem</a>.</p>
<div class="fragment"><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;                                {</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;    <span class="keywordflow">if</span> (!<a class="code" href="../../db/d41/class_shared_memory_semaphore.html#a7c24bb06e6a2fada9570f34a11afe87e">_init</a>) {</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;      <span class="keywordflow">if</span> (sem_init(&amp;<a class="code" href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">_sem</a>, 1, value)) {</div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;        printf(<span class="stringliteral">&quot;[ERROR] Failed to initialize shared memory semaphore: %s\n&quot;</span>,</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;               strerror(errno));</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;      } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <a class="code" href="../../db/d41/class_shared_memory_semaphore.html#a7c24bb06e6a2fada9570f34a11afe87e">_init</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;      }</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;    }</div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  }</div><div class="ttc" id="class_shared_memory_semaphore_html_abd4a2bf1a865ebb76bd57a8fcbcacdbe"><div class="ttname"><a href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">SharedMemorySemaphore::_sem</a></div><div class="ttdeci">sem_t _sem</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/dac/_shared_memory_8h_source.html#l00089">SharedMemory.h:89</a></div></div>
<div class="ttc" id="class_shared_memory_semaphore_html_a7c24bb06e6a2fada9570f34a11afe87e"><div class="ttname"><a href="../../db/d41/class_shared_memory_semaphore.html#a7c24bb06e6a2fada9570f34a11afe87e">SharedMemorySemaphore::_init</a></div><div class="ttdeci">bool _init</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/dac/_shared_memory_8h_source.html#l00090">SharedMemory.h:90</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-2" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-2-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-2-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-2-content" class="dyncontent" style="display:none;">
<div class="center"><img src="../../db/d41/class_shared_memory_semaphore_acb002c7dce852e4548ee4b8a32e67b97_icgraph.png" border="0" usemap="#db/d41/class_shared_memory_semaphore_acb002c7dce852e4548ee4b8a32e67b97_icgraph" alt=""/></div>
<map name="db/d41/class_shared_memory_semaphore_acb002c7dce852e4548ee4b8a32e67b97_icgraph" id="db/d41/class_shared_memory_semaphore_acb002c7dce852e4548ee4b8a32e67b97_icgraph">
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a1320f7671180868cccce16df1894f5d7"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedMemorySemaphore::tryDecrement </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>If the semaphore's value is &gt; 0, decrement the value and return true Otherwise, return false (doesn't decrement or wait) </p><dl class="section return"><dt>Returns</dt><dd></dd></dl>

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00066">66</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

<p>References <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00089">_sem</a>.</p>
<div class="fragment"><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;{ <span class="keywordflow">return</span> (sem_trywait(&amp;<a class="code" href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">_sem</a>)) == 0; }</div><div class="ttc" id="class_shared_memory_semaphore_html_abd4a2bf1a865ebb76bd57a8fcbcacdbe"><div class="ttname"><a href="../../db/d41/class_shared_memory_semaphore.html#abd4a2bf1a865ebb76bd57a8fcbcacdbe">SharedMemorySemaphore::_sem</a></div><div class="ttdeci">sem_t _sem</div><div class="ttdef"><b>Definition:</b> <a href="../../d2/dac/_shared_memory_8h_source.html#l00089">SharedMemory.h:89</a></div></div>
</div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="a7c24bb06e6a2fada9570f34a11afe87e"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">bool SharedMemorySemaphore::_init = false</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00090">90</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

</div>
</div>
<a class="anchor" id="abd4a2bf1a865ebb76bd57a8fcbcacdbe"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">sem_t SharedMemorySemaphore::_sem</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Definition at line <a class="el" href="../../d2/dac/_shared_memory_8h_source.html#l00089">89</a> of file <a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="../../d2/dac/_shared_memory_8h_source.html">SharedMemory.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../db/d41/class_shared_memory_semaphore.html">SharedMemorySemaphore</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
